@echo off

if "%1" == "" goto syntax_error
if "%2" == "" goto syntax_error
if "%3" == "" goto syntax_error
if "%4" == "" goto syntax_error

set TOOL_DBSERVER=%1
set TOOL_DBNAME=%2
set TOOL_DBACCOUNT=%3
set TOOL_DBPASSWORD=%4
set TOOL_DBDATADIR=Data

@echo Isert data....


@echo UserRole
call SqlCommand %TOOL_DBSERVER% %TOOL_DBNAME% %TOOL_DBACCOUNT% %TOOL_DBPASSWORD% %TOOL_DBDATADIR%\UserRole.sql
if errorlevel 1 goto sql_error

@echo TicketStatus
call SqlCommand %TOOL_DBSERVER% %TOOL_DBNAME% %TOOL_DBACCOUNT% %TOOL_DBPASSWORD% %TOOL_DBDATADIR%\TicketStatus.sql
if errorlevel 1 goto sql_error

@echo SpecialNeed
call SqlCommand %TOOL_DBSERVER% %TOOL_DBNAME% %TOOL_DBACCOUNT% %TOOL_DBPASSWORD% %TOOL_DBDATADIR%\SpecialNeed.sql
if errorlevel 1 goto sql_error

@echo ParvisProperties
call SqlCommand %TOOL_DBSERVER% %TOOL_DBNAME% %TOOL_DBACCOUNT% %TOOL_DBPASSWORD% %TOOL_DBDATADIR%\ParvisProperties.sql
if errorlevel 1 goto sql_error

@echo FeeSet
call SqlCommand %TOOL_DBSERVER% %TOOL_DBNAME% %TOOL_DBACCOUNT% %TOOL_DBPASSWORD% %TOOL_DBDATADIR%\FeeSet.sql
if errorlevel 1 goto sql_error

@echo InformationTextType
call SqlCommand %TOOL_DBSERVER% %TOOL_DBNAME% %TOOL_DBACCOUNT% %TOOL_DBPASSWORD% %TOOL_DBDATADIR%\InformationTextType.sql
if errorlevel 1 goto sql_error

@echo InformationTextType
call SqlCommand %TOOL_DBSERVER% %TOOL_DBNAME% %TOOL_DBACCOUNT% %TOOL_DBPASSWORD% %TOOL_DBDATADIR%\InformationText.sql
if errorlevel 1 goto sql_error

@echo EmailTemplate
call SqlCommand %TOOL_DBSERVER% %TOOL_DBNAME% %TOOL_DBACCOUNT% %TOOL_DBPASSWORD% %TOOL_DBDATADIR%\EmailTemplate.sql
if errorlevel 1 goto sql_error

@echo Language
call SqlCommand %TOOL_DBSERVER% %TOOL_DBNAME% %TOOL_DBACCOUNT% %TOOL_DBPASSWORD% %TOOL_DBDATADIR%\Language.sql
if errorlevel 1 goto sql_error

@echo CeremonyLanguage
call SqlCommand %TOOL_DBSERVER% %TOOL_DBNAME% %TOOL_DBACCOUNT% %TOOL_DBPASSWORD% %TOOL_DBDATADIR%\CeremonyLanguage.sql
if errorlevel 1 goto sql_error

@echo CertificateLanguage
call SqlCommand %TOOL_DBSERVER% %TOOL_DBNAME% %TOOL_DBACCOUNT% %TOOL_DBPASSWORD% %TOOL_DBDATADIR%\CertificateLanguage.sql
if errorlevel 1 goto sql_error

@echo ReportTextFieldDefinition
call SqlCommand %TOOL_DBSERVER% %TOOL_DBNAME% %TOOL_DBACCOUNT% %TOOL_DBPASSWORD% %TOOL_DBDATADIR%\ReportTextFieldDefinition.sql
if errorlevel 1 goto sql_error

@echo ReportMarriageCertificate
call SqlCommand %TOOL_DBSERVER% %TOOL_DBNAME% %TOOL_DBACCOUNT% %TOOL_DBPASSWORD% %TOOL_DBDATADIR%\ReportMarriageCertificate.sql
if errorlevel 1 goto sql_error

@echo ParvisUser
call SqlCommand %TOOL_DBSERVER% %TOOL_DBNAME% %TOOL_DBACCOUNT% %TOOL_DBPASSWORD% %TOOL_DBDATADIR%\ParvisUser.sql
if errorlevel 1 goto sql_error


@echo *************************************************************
@echo *
@echo * Data inserted successfully.
@echo *
@echo *************************************************************
goto end


:syntax_error
@echo *************************************************************
@echo *
@echo * Syntax error!
@echo * Required parameter is missing.
@echo *
@echo * Usage: InsertData 'DatabaseServerName' DatabaseName' 'Account' 'Password'
@echo *
@echo *************************************************************
goto end


:sql_error
:end
